#!/bin/bash
# 定义JSON文件和输出文件的位置
json_file="update/latest.json"
# 使用jq读取version值
version=$(jq -r '.version' "$json_file")

# 替换以下变量值
TOKEN=$GITEE_MAX_PAT
OWNER='gao-ling-feng'
REPO='guyun_download'
TAG=v$version
RELEASE_TITLE='Release Title'
RELEASE_NOTE='Release description here.'

# 创建发布
curl -X POST -H "Content-Type: application/json" -H "Authorization: token $TOKEN" \
-d "{\"tag_name\": \"$TAG\", \"title\": \"$RELEASE_TITLE\", \"name\": \"$TAG\", \"body\": \"$RELEASE_NOTE\",\"target_commitish\": \"$RELEASE_NOTE\"}" \
"https://gitee.com/api/v5/repos/$OWNER/$REPO/releases"